<?php

// @filename   member_type.php

class member_type extends Model {

    function member_type() {
        parent::Model();
    }

    function get_all_types() {
        $query = $this->db->get('member_types');
        return $query->result_array();
    }


    function get_type_info($id='') {
        if($id === '') {
            return;
        }
        $query = $this->db->get_where('member_types',array('id'=>$id));
        return $query->row_array();
    }

    function update_type_info($array) {
        $id = array_shift($array);
        $this->db->where('id',$id);
        return $this->db->update('member_types',$array);
    }

    function delete_type($id) {
        return $this->db->delete('member_types', array('id' => $id));
    }

    function insert_type($array) {
        return $this->db->insert('member_types',$array);
    }

}
?>